package cn.exrick.xboot.supervisionDepartment.controllerImpl

import cn.exrick.xboot.base.dto.EnterpriseUserCheckDto
import cn.exrick.xboot.base.dto.EnterpriseUserSearchDto
import cn.exrick.xboot.base.dto.SecurityAdvisorSearchDto
import cn.exrick.xboot.base.dto.SupervisionUserDto
import cn.exrick.xboot.base.service.IDepartmentUserService
import cn.exrick.xboot.base.service.ISupervisionUserService
import cn.exrick.xboot.base.vo.*
import cn.exrick.xboot.core.common.vo.PageVo
import cn.exrick.xboot.core.common.vo.Result
import cn.exrick.xboot.supervisionDepartment.controller.ISupervisionDepartmentController
import org.springframework.web.bind.annotation.RestController
import javax.annotation.Resource
import javax.validation.Valid

@RestController
class SupervisionDepartmentController: ISupervisionDepartmentController.ISupervisionUser {

    @Resource
    private lateinit var iSupervisionUserService: ISupervisionUserService

    @Resource
    private lateinit var iDepartmentUserService: IDepartmentUserService

    override fun createSupervisionUser(@Valid supervisionUserDto: SupervisionUserDto): Result<Any?>? {

        return iSupervisionUserService.createSupervisionUser(supervisionUserDto)
    }

    override fun updateSupervisionUser(@Valid supervisionUserDto: SupervisionUserDto): Result<Any?>? {

        return iSupervisionUserService.updateSupervisionUser(supervisionUserDto)
    }

    override fun removeSupervisionUser(vararg ids: String): Result<Any?>? {

        return iSupervisionUserService.removeSupervisionUser(ids)
    }

    override fun getSupervisionUserList(supervisionUserDto: SupervisionUserDto, pageVo: PageVo): Result<MutableMap<String, Any>>? {

        return iSupervisionUserService.getSupervisionUserList(supervisionUserDto, pageVo)
    }

    override fun forbiddenSupervisionUser(vararg ids: String): Result<Any?>? {

        return iSupervisionUserService.forbiddenSupervisionUser(ids)
    }

    override fun getSupervisionInfo(): Result<SupervisionUserInfoVo?>? {

        return iSupervisionUserService.getSupervisionInfo()
    }

    override fun getSupervisionExamByLevel(areaId: String): Result<List<UserCommonVo>>? {

        return iSupervisionUserService.getSupervisionExamByLevel(areaId)
    }

    override fun getSupervisionCheckByArea(areaId: String): Result<List<UserCommonVo>>? {

        return iSupervisionUserService.getSupervisionCheckByArea(areaId)
    }

    override fun resetPassword(id: String): Result<Any> {

        return iDepartmentUserService.resetPassword(id)
    }


    override fun getEnterpriseListByAreaId(enterpriseUserSearchDto: EnterpriseUserSearchDto, pageVo: PageVo?): Result<MutableMap<String, Any?>>? {

        return iSupervisionUserService.getEnterpriseListByAreaId(enterpriseUserSearchDto, pageVo)
    }

    override fun getEnterpriseDetail(id: String?): Result<EnterpriseUserDetailVo?>? {

        return iSupervisionUserService.getEnterpriseDetail(id)
    }

    override fun getSecurityAdvisorByAreaId(securityAdvisorSearchDto: SecurityAdvisorSearchDto, pageVo: PageVo?): Result<MutableMap<String, Any?>>? {

        return iSupervisionUserService.getSecurityAdvisorByAreaId(securityAdvisorSearchDto, pageVo)
    }

    override fun getSecurityAdvisorDetail(id: String?): Result<SecurityAdvisorDetailVo?>? {

        return iSupervisionUserService.getSecurityAdvisorDetail(id)
    }

}